package gttp.nspa.client.adm.rpc;

import gttp.nspa.shared.om.Billing;
import gttp.nspa.shared.om.Billing.Status;
import gttp.nspa.shared.om.MassaOrder;

import java.util.List;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

@RemoteServiceRelativePath("billing")
public interface IBillingService extends RemoteService {

    Billing load(long id);

    void save(Billing b);

    void delete(long id);

    void delete(Long[] ids);

    List<Billing> listBy(Long beginFrom,
                         Long beginTo,
                         Long endFrom,
                         Long endTo,
                         String alias,
                         String customer,
                         String locker,
                         Status status,
                         int offset,
                         int limit,
                         String[] orders);

    Billing book(String cashier, long custId);

    Billing book(String cashier, String custAlias);

    Billing open(long billId, String locker);

    Billing open(String cashier, long custId, String locker);

    Billing open(String cashier, String custAlias, String locker);

    boolean cancelOrder(long billId, long orderId, String reason);

    boolean serveOrder(long billId, long orderId);

    boolean serveOrderDone(long billId, long orderId);

    MassaOrder orderMassa(long billId, String therapist, String massa);

    void serveMassa(long billId);

}
